<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <style>
        body {
            height: 100vh;
        }
    
        main {
            width: 400px;
            height: 400px;
            border: solid 5px silver;
            position: relative;
        }
    
        main div {
            width: 100px;
            height: 100px;
            background: blueviolet;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
        }

        div:hover{
            transform: translate(100px,-50px);
        }
    </style>

    
<main>

    <div></div>

</main>

</body>
</html>